/**
 * 
 */
package com.couchcrowler.client.event;



import com.google.gwt.event.shared.GwtEvent;

/**
 * @author Vincentas
 *
 */
public class ErrorEvent extends GwtEvent<ErrorHandler> {

	private final Throwable throwable;
	
	public ErrorEvent(Throwable throwable) {
		this.throwable = throwable;
	}
	
	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<ErrorHandler> getAssociatedType() {
		return ErrorHandler.type;
	}

	@Override
	protected void dispatch(ErrorHandler handler) {
		handler.handleError(throwable);		
	}

}
